import fetch from '@/utils/fetch';
import { EBIZ_API } from '@/config/baseUrl';

export function getAdverisingList(params) {
	return fetch({
	    url: EBIZ_API + '/appAdmin_ad/list.do',
	    method: 'get',
	    
	    params
  	})
}

export function getJumpValue(params) {
	return fetch({
	    url: EBIZ_API + '//appAdmin_goods/listAll.do',
	    method: 'post',
	    params
  	})
}
export function getAdvertisingDetail(id) {
	return fetch({
	    url: EBIZ_API + `//appAdmin_ad/getInfo?AD_ID=${id}`,
	    method: 'get'
  	})
}

export function createAdvertising(data) {
	return fetch({
		url: EBIZ_API + '//appAdmin_ad/save.do',
		method: 'post',
		data
	})
}

export function modifyAdvertising( data) {
	return fetch({
	    url: EBIZ_API + '//appAdmin_ad/edit.do',
	    method: 'post',
	    data
	})
}

export const options = { //省     	
	 2: "url",
	10: "超市商品详情",
	11: "餐饮商品详情",
	12: "团购商品详情",
	20: "超市商品分类",
	21: "餐饮商品分类",
	22: "团购商品分类"
	
	
}

export const shop = { //省     	
	"1": "精品广告位推荐",
	"2": "超市广告位",
	"3": "餐饮广告位",
	"4": "团购广告位"
	
};
export const cancel = { //省     	
	
	"0": "未删除",
	"1": "已删除"
	
	
};
export const cancel_o = { //省     	
	"":"删除标记",
	"0": "未删除",
	"1": "已删除"
	
	
};

//删除广告（逻辑删除）
export function deleteAd(data){
	return fetch({
		url: EBIZ_API + '/appAdmin_ad/delete.do',
		method: 'post',
		data
	})
}